import request from "../utils/request";

export async function getETLData(data) {
  return request({
    method: "post",
    url: `/dataETL/data`,
    data
  });
}

export async function getDataETLList(params) {
  return request({
    method: "get",
    url: `/dataETL/list`,
    params
  });
}

export async function getDataETLAllList(params) {
  return request({
    method: "get",
    url: `/dataETL/all`,
    params
  });
}

export async function addDataETL(data) {
  return request({
    method: "post",
    url: `/dataETL/add`,
    data
  });
}

export async function editDataETL(data) {
  return request({
    method: "put",
    url: `/dataETL/edit`,
    data
  });
}

export async function saveDataETLDraft(data) {
  return request({
    method: "post",
    url: `/dataETL/saveDraft`,
    data
  });
}

export async function saveAndRunETL(data) {
  return request({
    method: "post",
    url: `/dataETL/saveAndRun`,
    data
  });
}

export async function delDataETL(data) {
  return request({
    method: "delete",
    url: `/dataETL/del`,
    data
  });
}

export async function detailETLById(params) {
  return request({
    method: "GET",
    url: `/dataETL/detail`,
    params
  });
}

export async function mysqlTables(params) {
  return request({
    method: "GET",
    url: `/dataETL/mysql/tables`,
    params
  });
}

export async function getETLTableFields(params) {
  return request({
    method: "GET",
    url: `/dataETL/mysql/fields`,
    params
  });
}

export async function getETLTableData(data) {
  return request({
    method: "Post",
    url: `/dataETL/table/data`,
    data
  });
}

export async function getETLNodeData(data) {
  return request({
    method: "Post",
    url: `/dataETL/node/data`,
    data
  });
}

export async function etlExec(data){
  return request({
    method: "Post",
    url: `/dataETL/etl/exec`,
    data
  });
}
